<?php

namespace Narti\BouncerBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as Unique;

/**
 * Narti\BouncerBundle\Entity\Landline
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Narti\BouncerBundle\Repository\LandlineRepository")
 * @Unique\UniqueEntity(fields={"bounce"})
 */
class Landline
{
     public function __construct()
     {
        $this->createdAt = new \DateTime();
     }
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $bounce
     *
     * @ORM\Column(name="bounce", type="string", length=32)
     * @Assert\NotBlank(message="Campo bounce obbligatorio")
     * @Assert\MaxLength(limit=24, message="Campo bounce massimo 24 caratteri")
     */
    private $bounce;

    /**
     * @var string $titolo
     *
     * @ORM\Column(name="titolo", type="string", length=128)
     * @Assert\NotBlank(message="Campo titolo obbligatorio")
     * @Assert\MaxLength(limit=64, message="Campo titolo massimo 64 caratteri")
     */
    private $titolo;

    /**
     * @var text $contenuto
     *
     * @ORM\Column(name="contenuto", type="text")
     * @Assert\NotBlank(message="Campo contenuto obbligatorio")
     */
    private $contenuto;

    /**
     * @var integer $rnd
     *
     * @ORM\Column(name="rnd", type="integer")
     */
    private $rnd;

    /**
     * @var datetime $createdAt
     *
     * @ORM\Column(name="createdAt", type="datetime")
     */
    private $createdAt;
    
     /**
     * @ORM\ManyToOne(targetEntity="Craft", inversedBy="landlines")
     * @ORM\JoinColumn(name="craft_id", referencedColumnName="id")
     * @Assert\NotBlank(message="Campo craft obbligatorio")
     */
    private $craft;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set bounce
     *
     * @param string $bounce
     */
    public function setBounce($bounce)
    {
        $this->bounce = $bounce;
    }

    /**
     * Get bounce
     *
     * @return string 
     */
    public function getBounce()
    {
        return $this->bounce;
    }

    /**
     * Set titolo
     *
     * @param string $titolo
     */
    public function setTitolo($titolo)
    {
        $this->titolo = $titolo;
    }

    /**
     * Get titolo
     *
     * @return string 
     */
    public function getTitolo()
    {
        return $this->titolo;
    }

    /**
     * Set contenuto
     *
     * @param text $contenuto
     */
    public function setContenuto($contenuto)
    {
        $this->contenuto = $contenuto;
    }

    /**
     * Get contenuto
     *
     * @return text 
     */
    public function getContenuto()
    {
        return $this->contenuto;
    }

    /**
     * Set rnd
     *
     * @param integer $rnd
     */
    public function setRnd($rnd)
    {
        $this->rnd = $rnd;
    }

    /**
     * Get rnd
     *
     * @return integer 
     */
    public function getRnd()
    {
        return $this->rnd;
    }

    
    /**
     * Get createdAt
     *
     * @return datetime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }
    
    /**
     * Set craft
     *
     * @param Narti\BouncerBundle\Entity\Craft $craft
     */
    public function setCraft($craft)
    {
        $this->craft = $craft;
    }

    /**
     * Get craft
     *
     * @return Narti\BouncerBundle\Entity\Craft $craft
     */
    public function getCraft()
    {
        return $this->craft;
    }
}